Navigation

    Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Search
    • Unsolved
    1. Home
    2. Tags
    3. icon
    Log in to post

    • UNSOLVED How to use SVG
      General and Desktop • widget svg icon • • Saviz  

      32
      0
      Votes
      32
      Posts
      1599
      Views

      So i am using Qt 6.2.2 & ran into the same problem the solution was : in the .pro file its QT+= svg svgwidgets now you can #include <QSvgWidgets> found it in the included svgviewer example in QT qtsvg-svgviewer-example hope i helped
    • UNSOLVED How do you properly increase QLineEdit increase icon size/
      General and Desktop • qlineedit size icon pixelated • • arjun98  

      4
      0
      Votes
      4
      Posts
      313
      Views

      @arjun98 said in How do you properly increase QLineEdit increase icon size/: ui->searchbar->setClearButtonEnabled(true); ui->searchbar->QLineEdit::addAction(QIcon(":/img/icons/icon_search.png"), QLineEdit::LeadingPosition); I have tried loading icon to line edit using above code, it's clearly visibile. and image is not blurred. try to experiment loading the icon to QLineEdit without any stylesheet being set to it.
    • UNSOLVED "Icon theme * not found." message when the icon theme is found
      General and Desktop • icon qicon theme icon in ubuntu • • Glax  

      1
      0
      Votes
      1
      Posts
      153
      Views

      No one has replied

    • UNSOLVED Animated icons
      QML and Qt Quick • qml animation icon • • 0...-5  

      6
      0
      Votes
      6
      Posts
      399
      Views

      Qt lottie might be an option. That's exactly its purpose
    • SOLVED How to get icon from any file?
      General and Desktop • icon • • AndrzejB  

      3
      0
      Votes
      3
      Posts
      1591
      Views

      2 works, thanks! But why 1 icon isNull() ? Is possible 1 and 2 under Linux? Linux has something like mime or/and Elf binaries can holds icons? Bad: QPixmap extractMime(const QString &sourceFile) { QMimeDatabase mime_database; const QString nativeName = QDir::toNativeSeparators(sourceFile); QIcon icon; QList<QMimeType> mime_types = mime_database.mimeTypesForFileName(nativeName); icon = QIcon::fromTheme(mime_types[0].iconName()); if (icon.isNull()) qDebug() << "null"; qDebug() << mime_types[0].iconName(); return icon.pixmap(16); } Maybe this work for Linux, but for Windows I need registers. Sample C# application https://www.codeproject.com/Articles/29137/Get-Registered-File-Types-and-Their-Associated-Ico for example: Computer\HKEY_CLASSES_ROOT.mp3 has OpenWithProgIds/WMP11.AssocFile.MP3 Computer\HKEY_CLASSES_ROOT\WMP11.AssocFile.MP3 has DefaultIcon = %SystemRoot%\system32\wmploc.dll,-732 wmploc.dll is resources and 732 index of icon?
    • UNSOLVED How to set Task Bar icon depending on state of Qt app?
      General and Desktop • windows 10 msvc2015 icon innosetup • • michalos  

      1
      0
      Votes
      1
      Posts
      884
      Views

      No one has replied

    • SOLVED TreeView Hide Column hides the expand / collapse icon and prints plain Table
      General and Desktop • treeview icon column expand symbol • • Opa114  

      3
      0
      Votes
      3
      Posts
      1551
      Views

      Good to know, so my solution to store this in the last column and hide this one is the best solution for me.
    • SOLVED QListWidget with dynamic icons
      General and Desktop • qlistwidget icon qlistwidgetitem • • Harry123  

      12
      0
      Votes
      12
      Posts
      4385
      Views

      It's good when it's more friendly :)
    • UNSOLVED How to add icon without a text into QListWidget?
      General and Desktop • icon listwidget no text • • IL  

      10
      0
      Votes
      10
      Posts
      6195
      Views

      @IL you can add a widget to an item. So just create a for example frame that contains your icon and add it to the list item. QListWidget *list = new QListWidget(this); //... QFrame *custom = new QFrame; //add whatever you need to the frame QListWidgetItem *i = new QListWidgetItem; list->addItem(i); list->setWidgetItem(i,custom); I used this for a list where each item needed several buttons to get for example detailed information about the item or delete the item from the list with one click
    • UNSOLVED QToolbar on OSX: no hover effect
      General and Desktop • desktop os x qtoolbar qaction icon • • Xanx  

      5
      0
      Votes
      5
      Posts
      1900
      Views

      Please have some patience, this forum is community driven and not all users live in the same timezone as you. The picture you are linking to doesn't show a hovered button but a checked button. You will have that visual effect if you set the checkable property of the action to corresponding to the button as true and you check it.
    • Help with info.plist
      Mobile and Embedded • ios icon status bar info.plist • • VictorKoenders  

      1
      0
      Votes
      1
      Posts
      588
      Views

      No one has replied

    • How To Style QPushButton Icon?
      General and Desktop • qt5.5 stylesheet qpushbutton style icon position positioning • • maximo  

      8
      0
      Votes
      8
      Posts
      9065
      Views

      @maximo Agree. I wonder if there is something secret I missed in some Doc.
    • Display icon into QLabel [SOLVED]
      General and Desktop • c++ linux qlabel icon • • marlenet15  

      4
      0
      Votes
      4
      Posts
      20313
      Views

      Something like: QIcon icon = style()->standardIcon(QStyle::SP_DialogOkButton); QPixmap pixmap = icon.pixmap(QSize(64, 64));
    • How to make default icon bigger when button changes size? [SOLVED]
      General and Desktop • c++ linux button size icon • • marlenet15  

      2
      0
      Votes
      2
      Posts
      1592
      Views

      @marlenet15 See the docs : http://doc.qt.io/qt-5/qabstractbutton.html#iconSize-prop
    • Set icon to QTreeWidgetItem causes crash
      General and Desktop • crash icon qtreewidgetitem • • MohammadReza  

      12
      0
      Votes
      12
      Posts
      4412
      Views

      What is the stack trace when this happens ?
    • [SOLVED] QPushButton and Icon -- How To Move Icon More To The Left?
      General and Desktop • qpushbutton icon qproperty styling • • maximo  

      2
      0
      Votes
      2
      Posts
      11322
      Views

      After scouring the web, it appears that the only way to do this is the very complex technique of subclassing the widget. It's easier to just put another button on it, but then I had the problem where I couldn't pass a hover event to the QPushButton underneath it. This lead me to learn the technique on StackOverflow of building an eventFilter.
    • QToolBar - real Icon Size / Minimum Size
      General and Desktop • size qtoolbar qaction icon icons sizepolicy sizehint • • Cluosh  

      2
      0
      Votes
      2
      Posts
      2150
      Views

      The thing is that toolbars don't really display icons. They display widgets (that can have icons). By default when you add an action to a toolbar a QToolButton is created for it, but you are not limited to that and can add any widget e.g. an expanding line edit, combobox or a button with an icon and text. All of these can have different size policies, be expanding or have a custom stylesheet applied. All of this makes calculating such size not feasible because how would you calculate it if a widget can change its size. What I'm saying is that yours is a special, very specific case (with just icons), and as such you need to handle it yourself if you want to. To answer your questions: It's not one thing that adds the space. There are couple of aspects that can contribute. You can control some(or all?) of them with stylesheets e.g. set padding of the toolbar and toolbuttons to 0 and margins and borders of the toolbuttons. By default all of these depend on a style and will vary across computers. You also need to be careful to consider the size of the toolbar handle (if it's movable) as its size depends on the active style. You also need to consider that if the icon is narrower than the iconSize then there's gonna by space left anyway. nope, AFAIK it can vary from one item of the toolbar to another if you set it this way nope and just out of curiosity - why do you need that? The bar will display an arrow button that will let you see the overflowing items. Also such calculated size would be useless as the window can be resized and thus the toolbar too (unless you're doing some really fancy layout).
    • [SOLVED] Set table view column full of clickable icons
      General and Desktop • qtableview icon icons • • mkolenda  

      2
      0
      Votes
      2
      Posts
      1544
      Views

      Hi I would say a Delegate would be the way to do it. Have a look at "Star Delegate Example" For your fancy hand, you can use QApplication::setOverrideCursor(QCursor(Qt::PointingHandCursor)); QApplication::restoreOverrideCursor(); Its also possible via the model http://daniel-albuschat.blogspot.dk/2009/09/setting-mouse-cursor-for-qts-item-views.html
    • Adding Icon on top of Text in a QPushButton
      General and Desktop • qpushbutton icon top • • Pranjal Jain  

      2
      0
      Votes
      2
      Posts
      3141
      Views

      Hi and welcome to devnet, Why not just call setIcon with your current icon ? No need for a style sheet
    • [SOLVED] QSystemTrayIcon icon from resource file isn't showing
      General and Desktop • icon resource qsystemtrayicon • • nitzan  

      26
      0
      Votes
      26
      Posts
      11345
      Views

      Good, glad ya got it sorted out. Sorry I've been super busy lately and haven't lurked the forums here. :)
    • Get icon for .url files on Windows
      General and Desktop • windows icon • • hinst  

      1
      0
      Votes
      1
      Posts
      761
      Views

      No one has replied

    • Qt icons
      General and Desktop • icon • • Annili  

      1
      0
      Votes
      1
      Posts
      440
      Views

      No one has replied

    • QPushButton icon auto resize
      General and Desktop • qpushbutton resize icon automatic • • Romain C  

      2
      0
      Votes
      2
      Posts
      3516
      Views

      After all this time, I don't fin a way to do it properly. I'm using QML and it's fine now. For people intereested in, this is my QML component: import QtQuick 2.5 import QtQuick.Controls 1.4 import QtQuick.Controls.Styles 1.4 Button { property color backgroundColor property alias tooltip : buttonAction.tooltip property string imageSource signal buttonClicked ( ) action : buttonAction activeFocusOnPress : true Keys.onPressed : { if ( (event.key == Qt.Key_Return||event.key == Qt.Key_Enter) && activeFocus) { buttonClicked ( ); event.accepted = true; } } style : ButtonStyle { background: Rectangle { id : backgroundRectangle color : backgroundColor Rectangle { id : roundedRectangle color : control.pressed?Qt.darker(backgroundColor, 1.1):backgroundColor anchors.fill : parent radius : 10 scale : ( control.hovered||control.activeFocus )?1:0.9 Image { id : buttonImage anchors.fill: parent fillMode : Image.PreserveAspectFit source : imageSource } } } } Action { id : buttonAction onTriggered : buttonClicked () } }
    • ToolButton iconSource Size doesn't fill button Size on Android
      QML and Qt Quick • icon toolbar • • didu  

      1
      0
      Votes
      1
      Posts
      911
      Views

      No one has replied

    • Icon Dialog
      QML and Qt Quick • dialog icon • • didu  

      12
      0
      Votes
      12
      Posts
      6569
      Views

      @p3c0 said in Icon Dialog: @didu Icon specified through RC_ICONS will not be available at runtime in the code. It is used to set the icon for the executable which is created after compiling. In your case you need to store the icon in Qt's Resource System by creating a .qrc file. After that it will be accessible from the code. Eg: app.setWindowIcon(QIcon("qrc:/images/logo.ico")); Another quick way to test it ls loading the ico file from a physical location. Eg: app.setWindowIcon(QIcon("D:/MyIcons/logo.ico")); The above should work too. But a more practical approach is to use the Resource files. More info here. I was facing a similar issue with the icon being loaded successfully from its physical location but not from the resource file. So I tried app.setWindowIcon(QIcon(":/Images/IconFile.ico")); where "qrc" is removed which worked seamlessly.
    • Set Icon of my .exe File
      General and Desktop • icon • • max-253yomann  

      6
      0
      Votes
      6
      Posts
      12394
      Views

      Deleting the output directory and rebuilding does not work. Now I created a new project and now it works. Thank You :)