Git Product home page Git Product logo

qt-material-widgets's Introduction

Qt Material Design Desktop Widgets Language Join the chat at https://gitter.im/qt-material-widgets/Lobby

YouTube video preview available here.

App Bar QtMaterialAppBar
Auto Complete QtMaterialAutoComplete
Avatar QtMaterialAvatar
Badge QtMaterialBadge
Check Box QtMaterialCheckBox
Circular Progress QtMaterialCircularProgress
Dialog QtMaterialDialog
Drawer QtMaterialDrawer
FAB QtMaterialFloatingActionButton
Flat Button QtMaterialFlatButton
Icon Button QtMaterialIconButton
Progress QtMaterialProgress
Radio Button QtMaterialRadioButton
Raised Button QtMaterialRaisedButton
Scroll Bar QtMaterialScrollBar
Slider QtMaterialSlider
Snackbar QtMaterialSnackBar
Tabs QtMaterialTabs
Text Field QtMaterialTextField
Toggle QtMaterialToggle

Implemented components

  • App Bar
  • Auto Complete
  • Avatar
  • Badge
  • Check Box
  • Circular Progress
  • Dialog
  • Drawer
  • Floating Action Button
  • Flat Button
  • Icon Button
  • Progress
  • Radio Button
  • Raised Button
  • Scroll Bar
  • Slider
  • Snackbar
  • Tabs
  • Text Field
  • Toggle

Work in progress

  • Divider
  • List
  • List Item
  • Menu
  • Paper
  • Snackbar Layout
  • Table

Not implemented

  • Card
  • Chips
  • Discrete Slider
  • Grid List
  • Icon Menu
  • Search Field
  • Select Field
  • Stepper
  • Subheaders
  • Toolbar

qt-material-widgets's People

Contributors

fperillo avatar gitter-badger avatar jpcima avatar laserpants avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

qt-material-widgets's Issues

The font size in theme

Hello, how can I change the font size, the default font is a bit small, it is not clear in the program, thank you very much.

QtMaterialDialog: overlay gets wrong size and position

When I am instantiating an object of QtMaterialDialog class, the overlay gets incorrectly positioned and resized. I do it this way:

// Show Preferences
QtMaterialDialog* prefs = new QtMaterialDialog(this);
// Adding child objects and stuff
. . .
prefs->setWindowLayout(dialogLayout);
prefs->show();
prefs->showDialog();

The possible solution is to call setGeometry(overlayGeometry()) in the constructor of QtMaterialOverlayWidget:

QtMaterialOverlayWidget::QtMaterialOverlayWidget(QWidget *parent)
: QWidget(parent)
{
    if (parent) {
        parent->installEventFilter(this);
        setGeometry(overlayGeometry() );
    }
}

The old version of QtMaterialOverlayWidget's constructor was:

QtMaterialOverlayWidget::QtMaterialOverlayWidget(QWidget *parent)
    : QWidget(parent)
{
    if (parent) {
        parent->installEventFilter(this);
    }
}

About the build process

The build process using command line on windows fails to build examples. I see 3 errors:

  1. when I ask to use more than 1 core with -j 8, the examples are built immediately, and of course they fail since the library is not built yet. This is probably a side-effect of 3.

  2. the c++11 config added in your last is not "expanded" to examples\makefile.release. You can remove from qt-material-widgets.pro and add in examples.pro. Now -std=c++0x is added and compilation is ok. I don't know why it "downgrades" to c++0x but qmake knows better than me...

  3. The dependency of the lib is not satisfied.

win-make[2]: Entering directory 'C:/cvs/qt-material-widgets/components'
win-make[2]: Nothing to be done for 'first'.
win-make[2]: Leaving directory 'C:/cvs/qt-material-widgets/components'
win-make[1]: Leaving directory 'C:/cvs/qt-material-widgets/components'
cd examples\ && ( if not exist Makefile C:\qt\qt5.5.0\5.5\mingw492_32\bin\qmake.exe C:\cvs\qt-material-widgets\examples\
examples.pro -o Makefile ) && C:/cvs/harbour/win-make -f Makefile
win-make[1]: Entering directory 'C:/cvs/qt-material-widgets/examples'
C:/cvs/harbour/win-make -f Makefile.Release
win-make[2]: Entering directory 'C:/cvs/qt-material-widgets/examples'
win-make[2]: *** No rule to make target '../components/libcomponents.a', needed by 'examples-exe.exe'.  Stop.
win-make[2]: Leaving directory 'C:/cvs/qt-material-widgets/examples'
Makefile:34: recipe for target 'release' failed
win-make[1]: *** [release] Error 2
win-make[1]: Leaving directory 'C:/cvs/qt-material-widgets/examples'
makefile:64: recipe for target 'sub-examples-make_first' failed
win-make: *** [sub-examples-make_first] Error 2

I had to add the directory to examples.pro:

diff --git a/examples/examples.pro b/examples/examples.pro
index b53fb99..a29c562 100644
--- a/examples/examples.pro
+++ b/examples/examples.pro
@@ -1,4 +1,5 @@
 QT += core gui widgets
+CONFIG += c++11
 TEMPLATE = app
 SOURCES = mainwindow.cpp \
     main.cpp \
@@ -39,10 +40,10 @@ HEADERS = mainwindow.h \
     dialogsettingseditor.h \
     drawersettingseditor.h \
     scrollbarsettingseditor.h
-LIBS += ../components/libcomponents.a
+LIBS += ../components/release/libcomponents.a
 INCLUDEPATH += ../components/
 TARGET = ../examples-exe
-PRE_TARGETDEPS += ../components/libcomponents.a
+PRE_TARGETDEPS += ../components/release/libcomponents.a

 RESOURCES += \
     examples.qrc

About ListItem object

I was about to complete the 3 variants of the ListItem object: 1, 2 and 3 lines are the basic variants, icons and avatars are ancillary.

I started with the idea to have 3 QString and adapt height and geometry based on the number of text lines set.

Then I played with the idea of a AbstractLineItem with base methods/data from which derive Divider and ListItem1, ListItem2 and ListItem3.

I then played with the idea of switching from a completely "ownerdrawn" widget, to a widget made with a layout and composed by different widgets. It would be easier to later implement advanced and interactive features like menus, expanders, etc. What do you think would be better? With ownerdrawn we have complete control on how to paint the widget, with layout we should double check everything...

Comparing material-ui and material.io I found discrepancies in what it is possible to implement. One is the possibility to have left and right icons: the specs don't have them listed, no measures... there is only one picture (look at Ali Connors picture, with left telephone icon and right quote icon).

The effects and shadows are CPU expensive.

If you open the Dialog box in the example application, it eats 20-25% of CPU in core i3!!!

I am using many controls including flatbutton, dialog, drawer, slider, etc in my application, but now the application takes > 25% CPU in just standby mode.

Any workaround to optimize this will be appreciated.

QtMaterialDialog: dialog is invisible without calling QWidget::show()

When I am instantiating an object of QtMaterialDialog class, the dialog becomes visible only after calling QWidget's show() method:

// Show Preferences
QtMaterialDialog* prefs = new QtMaterialDialog(this);
// Adding child objects and stuff
. . .
prefs->setWindowLayout(dialogLayout);
prefs->show(); // This call is necessary (!)
prefs->showDialog();

Questions about deployment

Excuse me for bothering you. How can I add control (like click action) to the buttons in tabs? I mean TabsSettingsEditor, which is declared in tabssettingseditor.h. Is there some example of using this repository?

Thank you!

problems with font (introducing ListItem)

In my fork I pushed a first try at ListItem. It is a test.. and both worked and not worked...
one-line_listitem

As you can see, the font is "strange"... I think that Qt is stretching it a bit...

I did some more tests and noticed that I don't have Roboto font installed on my workstation. And that the library doesn't load them with ::addApplicationFont.
Also loading the font, I still have problems, the font is not used. If I ask for an installed font, it is used without problem.
Also trying to load another external font I get the default font....

Actually, wherever you have to use this code snippet:

   QFont font(db.font("Roboto", "Regular", 16));
   font.setPointSize(16); // it should not be necessary

means that font object has no size 16 and you have to force it....

I don't know what other test to do...

Do you have the font installed?

drawLine( 2.5

I could not find a drawLine( float, only int.... isn't 2.5 casted to int by the compiler?

method naming

I'd like to know where are you taking the name of the methods from so to be consistent with your naming
My sources are http://www.material-ui.com/#/components/text-field
and https://material.io/guidelines/components/text-fields.html#text-fields-layout

For example in TextField we have the moving label:

  • you called it Label (setLabel)
  • Material-UI calls it Floating Label
  • material.io calls it

The placeholder text

  • Qt calls it placeholderText
  • you didn't call it (it is inheirted by QLineEdit so use Qt name)
  • Material-UI calls it Hint Text
  • material.io calls it Placeholder text (Hint text)

Are you following the meterial.io naming?

Examples don't link on windows with visual studio 2015 toolset

The examples don't link on windows with visual studio 2015 toolset. In the examples.pro the dependency on the component library is specified as libcomponents.a. However the visual studio toolset generates a components.lib file. Changing the name in the examples. pro resolves this porblem for the visual studio toolset (but brake the mingw 32 build). My qmake knowledge is too limited to provide a general solution.

LIBS += $$top_builddir/components/$(OBJECTS_DIR)/components.lib
PRE_TARGETDEPS += $$top_builddir/components/$(OBJECTS_DIR)/components.lib

pixels, dimensions inside and of the widget

Can you please spend a little time to document in the wiki:

  1. how to convert pixels, fonts, spacings described in material.io to qtmaterial
    f.e. in this widget https://material.io/guidelines/components/expansion-panels.html#expansion-panels-behavior and if you scroll above, all the other settings.
  2. How TextField determines its dimensions, expecially its height... you draw in the paintEvent but how are you sure you have that space? What if I'd add the error line below the underline? I was expecting a sizeHint, a policy...

Thanks

Add Q_PROPERTY declarations where it makes sense

For example, QtMaterialTextField has

    Q_PROPERTY(QColor textColor WRITE setTextColor READ textColor)
    Q_PROPERTY(QColor inkColor WRITE setInkColor READ inkColor)
    Q_PROPERTY(QColor underlineColor WRITE setUnderlineColor READ underlineColor)

but no equivalent property declaration for labelColor.

Error Compile in VS2013 Compiler

qtmaterialtabs.cpp
B:\Dev\Qt\test\gui\qt-material-widgets-master\components\qtmaterialtabs.cpp(21) : error C3083: '{ctor}': the symbol to the left of a '::' must be a type
B:\Dev\Qt\test\gui\qt-material-widgets-master\components\qtmaterialtabs.cpp(22) : error C2533: 'QtMaterialTabsPrivate::init' : constructors not allowed a return type
qtmaterialautocomplete.cpp
B:\Dev\Qt\test\gui\qt-material-widgets-master\components\qtmaterialautocomplete.cpp(159) : error C3083: '{ctor}': the symbol to the left of a '::' must be a type
B:\Dev\Qt\test\gui\qt-material-widgets-master\components\qtmaterialautocomplete.cpp(160) : error C2533: 'QtMaterialAutoComplete::event' : constructors not allowed a return type
B:\Dev\Qt\test\gui\qt-material-widgets-master\components\qtmaterialautocomplete.cpp(160) : error C2556: 'QtMaterialAutoComplete::QtMaterialAutoComplete(QEvent *)' : overloaded function differs only by return type from 'bool QtMaterialAutoComplete::event(QEvent *)'
b:\dev\qt\test\gui\qt-material-widgets-master\components\qtmaterialautocomplete.h(25) : see declaration of 'QtMaterialAutoComplete::event'
Generating Code...

idea of switch to CMake build system

is it nessery or not to switch the current qmake system to CMake?

personally, i perfer to CMake cause which is more "social". developers do not need to stick with the entire qt tool chains. secondlly, cmake-gui provides a more interactable way to manage build process by few clicking. last but not least the project can be configured to link against different version of qt release, which is good to test the qt-material-widgets compatibility, easily.

a test cmake building system over the project is presented in my local fork:develop. pls comment on it.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.